package com.gitee.neuray.security.admin.codelist.biz;

import com.gitee.neuray.security.common.util.QueryExple;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Service;

import java.lang.reflect.ParameterizedType;
import java.util.List;
import java.util.Map;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import tk.mybatis.mapper.common.Mapper;
import com.gitee.neuray.security.common.biz.BaseBiz;

import com.gitee.neuray.security.admin.codelist.mapper.SysCodeListMapper;
import com.gitee.neuray.security.admin.codelist.entity.SysCodeListEntity;
import tk.mybatis.mapper.entity.Example;


@Service
@Transactional(rollbackFor = Exception.class)
public class SysCodeListBiz extends BaseBiz<SysCodeListMapper,SysCodeListEntity> {
    @Override
    protected String getPageName() {
        return "SysCodeList"+"Biz";
    }

    public List<SysCodeListEntity> selectCodes(String name) {
        Example example = new Example(SysCodeListEntity.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("flag","1");
        if(!StringUtils.isEmpty(name)){
            criteria.andEqualTo("name",name);
        }
        return mapper.selectByExample(example);
    }
}
